package com.zhiche.lisa.oms.dao.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zhiche.lisa.oms.vo.LocationVo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 订单
 * </p>
 *
 * @author qichao
 * @since 2018-08-29
 */
@TableName("lisa_order")
public class Order extends Model<Order> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
    /**
     * 订单编号
     */
	private String code;
    /**
	 * 客户名称
	 */
	@TableField("customer_name")
	private String customerName;
	/**
	 * 订单备注
	 */
	private String comment;
    /**
     * 业务类型(TypeOfService)
     */
	private String tos;
    /**
     * 下单账号ID
     */
	private Long issuer;
    /**
     * 订单当前状态
     */
	@TableField("current_status")
	private String currentStatus;
    /**
     * 客户下单时间
     */
	@TableField("gmt_issue")
	private Date gmtIssue;
    /**
     * 系统创建时间
     */
	@TableField("gmt_create")
	private Date gmtCreate;
    /**
     * 要求提货时间
     */
	@TableField("gmt_expect_lading")
	private Date gmtExpectLading;
    /**
     * 要求交货时间
     */
	@TableField("gmt_expect_delivery")
	private Date gmtExpectDelivery;
    /**
     * 要求发货时间
     */
	@TableField("gmt_expect_shipping")
	private Date gmtExpectShipping;
    /**
     * 客户标识
     */
	@TableField("customer_id")
	private String customerId;
    /**
     * 客户订单编号
     */
	@TableField("customer_order_id")
	private String customerOrderId;


	@TableField(exist = false)
	private OrderContact orderContact;

	@TableField(exist = false)
	private OrderLocation orderLocation;

	/**
	 * 租户ID
	 */
	@TableField("tenant_id")
	private Long tenantId;

	@TableField(exist = false)
	private List<OrderItem> orderItemList;

	@TableField(exist = false)
	private List<LocationVo> location;

	/**
	 * 起始地 站点顺序
	 */
	@TableField(exist = false)
	private String originLocationSequence;

	/**
	 * 目的地 站点顺序
	 */
	@TableField(exist = false)
	private String destLocationSequence;

	@TableField("is_delete")
	@TableLogic
	private Integer isDelete;

	@TableField("trans_type_id")
	private Long transTypeId;

	public Long getTransTypeId() {
		return transTypeId;
	}

	public void setTransTypeId(Long transTypeId) {
		this.transTypeId = transTypeId;
	}

	public Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getTos() {
		return tos;
	}

	public void setTos(String tos) {
		this.tos = tos;
	}

	public Long getIssuer() {
		return issuer;
	}

	public void setIssuer(Long issuer) {
		this.issuer = issuer;
	}

	public String getCurrentStatus() {
		return currentStatus;
	}

	public void setCurrentStatus(String currentStatus) {
		this.currentStatus = currentStatus;
	}

	public Date getGmtIssue() {
		return gmtIssue;
	}

	public void setGmtIssue(Date gmtIssue) {
		this.gmtIssue = gmtIssue;
	}

	public Date getGmtCreate() {
		return gmtCreate;
	}

	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	public Date getGmtExpectLading() {
		return gmtExpectLading;
	}

	public void setGmtExpectLading(Date gmtExpectLading) {
		this.gmtExpectLading = gmtExpectLading;
	}

	public Date getGmtExpectDelivery() {
		return gmtExpectDelivery;
	}

	public void setGmtExpectDelivery(Date gmtExpectDelivery) {
		this.gmtExpectDelivery = gmtExpectDelivery;
	}

	public Date getGmtExpectShipping() {
		return gmtExpectShipping;
	}

	public void setGmtExpectShipping(Date gmtExpectShipping) {
		this.gmtExpectShipping = gmtExpectShipping;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public String getCustomerOrderId() {
		return customerOrderId;
	}

	public void setCustomerOrderId(String customerOrderId) {
		this.customerOrderId = customerOrderId;
	}

	public Long getTenantId() {
		return tenantId;
	}

	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public OrderContact getOrderContact() {
		return orderContact;
	}

	public void setOrderContact(OrderContact orderContact) {
		this.orderContact = orderContact;
	}

	public OrderLocation getOrderLocation() {
		return orderLocation;
	}

	public void setOrderLocation(OrderLocation orderLocation) {
		this.orderLocation = orderLocation;
	}

	public List<OrderItem> getOrderItemList() {
		return orderItemList;
	}

	public void setOrderItemList(List<OrderItem> orderItemList) {
		this.orderItemList = orderItemList;
	}

	public String getOriginLocationSequence() {
		return originLocationSequence;
	}

	public void setOriginLocationSequence(String originLocationSequence) {
		this.originLocationSequence = originLocationSequence;
	}

	public String getDestLocationSequence() {
		return destLocationSequence;
	}

	public void setDestLocationSequence(String destLocationSequence) {
		this.destLocationSequence = destLocationSequence;
	}

	public List<LocationVo> getLocation() {
		return location;
	}

	public void setLocation(List<LocationVo> location) {
		this.location = location;
	}

	@Override
	public String toString() {
		return "Order{" +
				"id=" + id +
				", code='" + code + '\'' +
				", customerName='" + customerName + '\'' +
				", comment='" + comment + '\'' +
				", tos='" + tos + '\'' +
				", issuer=" + issuer +
				", currentStatus='" + currentStatus + '\'' +
				", gmtIssue=" + gmtIssue +
				", gmtCreate=" + gmtCreate +
				", gmtExpectLading=" + gmtExpectLading +
				", gmtExpectDelivery=" + gmtExpectDelivery +
				", gmtExpectShipping=" + gmtExpectShipping +
				", customerId='" + customerId + '\'' +
				", customerOrderId='" + customerOrderId + '\'' +
				", orderContact=" + orderContact +
				", orderLocation=" + orderLocation +
				", tenantId=" + tenantId +
				", orderItemList=" + orderItemList +
				", location=" + location +
				", originLocationSequence='" + originLocationSequence + '\'' +
				", destLocationSequence='" + destLocationSequence + '\'' +
				", isDelete=" + isDelete +
				", transTypeId=" + transTypeId +
				'}';
	}
}
